﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using MvvmCross.Commands;
using MvvmCross.Platforms.Console.Views;
using MvvmCross.ViewModels;

namespace WpfApp_Mvvm.ViewModels
{
    public class MainViewModel : MvxViewModel
    {
        private string _message;

        public string Message
        {
            get => _message;
            set
            {
                _message = value;
                RaisePropertyChanged();
            }
        }

        public string Title
        {
            get => _title;
            set
            {
                _title = value;
                RaisePropertyChanged();
            }
        }

        public string _title;

        public MvxCommand ShowCommand { get; }

        public MainViewModel()
        {
            ShowCommand = new MvxCommand(ShowMessage);
            this.Message = "Hello";
            this.Title = "World";
        }

        public void ShowMessage()
        {
            this.Message = "你好";
            this.Title = "世界";
            MessageBox.Show($"{this.Message} {this.Title}");
        }


    }
}
